package br.ufs.dcomp.lsp;

import java.util.concurrent.LinkedBlockingQueue;

public class LspConnection implements Sender {
	
	boolean active = true;
	private int ID;
	Sender sender;
	private static LinkedBlockingQueue<Pack> packetsToSend;
	short packetWaitingForACK = -1;

	public LspConnection(int ID) {
		this.ID = ID;

	}

	public void addPack(Pack p) throws InterruptedException {
		packetsToSend.put(p);
	}

	public int getID() {
		return ID;
	}

	@Override
	public boolean isActive() {
		return this.active;
	}

	@Override
	public LinkedBlockingQueue<Pack> getPacketsToSend() {
		return this.packetsToSend;
	}

	@Override
	public short getPacketWaitingForAck() {
		return this.packetWaitingForACK;
	}

	@Override
	public void setPacketWaitingForAck(short sequenceNumber) {
		this.packetWaitingForACK = sequenceNumber;
	}
	
	

}
